// Copyright 2021 ETH Zurich and University of Bologna.
// Solderpad Hardware License, Version 0.51, see LICENSE for details.
// SPDX-License-Identifier: SHL-0.51
//
// Author: Matteo Perotti <mperotti@iis.ee.ethz.ch>
//         Basile Bougenot <bbougenot@student.ethz.ch>

#include "float_macros.h"
#include "vector_macros.h"

// We assume RNE rounding when not specified by the encoding

////////////////
// vfcvt.xu.f //
////////////////

void TEST_CASE1(void) {
  VSET(16, e16, m1);
  //              -2372.000,   2978.000, -5132.000, -3426.000, -3878.000,
  //              9680.000,   76.000, -8128.000, -2314.000, -4660.000, 8672.000,
  //              8824.000, -5732.000, -1557.000, -2302.000, -407.250
  VLOAD_16(v2, 0xe8a2, 0x69d1, 0xed03, 0xeab1, 0xeb93, 0x70ba, 0x54c0, 0xeff0,
           0xe885, 0xec8d, 0x703c, 0x704f, 0xed99, 0xe615, 0xe87f, 0xde5d);
  asm volatile("vfcvt.xu.f.v v3, v2");
  //                       0,       2978,          0,          0,          0,
  //                       9680,         76,          0,          0,          0,
  //                       8672,       8824,          0,          0,          0,
  //                       0
  VCMP_U16(1, v3, 0x0000, 0x0ba2, 0x0000, 0x0000, 0x0000, 0x25d0, 0x004c,
           0x0000, 0x0000, 0x0000, 0x21e0, 0x2278, 0x0000, 0x0000, 0x0000,
           0x0000);

  VSET(16, e32, m1);
  //              -82436.352, -5427.481, -30119.082,   53784.066,   76500.719,
  //              65152.020, -94151.375,   71894.320, -20547.545,   95485.906,
  //              92834.711, -28081.711, -9716.506,   62508.508,   90410.883,
  //              42708.285
  VLOAD_32(v2, 0xc7a1022d, 0xc5a99bd9, 0xc6eb4e2a, 0x47521811, 0x47956a5c,
           0x477e8005, 0xc7b7e3b0, 0x478c6b29, 0xc6a08717, 0x47ba7ef4,
           0x47b5515b, 0xc6db636c, 0xc617d206, 0x47742c82, 0x47b09571,
           0x4726d449);
  asm volatile("vfcvt.xu.f.v v3, v2");
  //                           0,              0,              0, 53784, 76501,
  //                           65152,              0,          71894, 0, 95486,
  //                           92835,              0,              0, 62509,
  //                           90411,          42708
  VCMP_U32(2, v3, 0x00000000, 0x00000000, 0x00000000, 0x0000d218, 0x00012ad5,
           0x0000fe80, 0x00000000, 0x000118d6, 0x00000000, 0x000174fe,
           0x00016aa3, 0x00000000, 0x00000000, 0x0000f42d, 0x0001612b,
           0x0000a6d4);

  VSET(16, e64, m1);
  //                3554390.405,   3670449.443,   3880983.535,   3452087.537,
  //                -5447847.496,   498812.179,   9535291.051,   113884.868,
  //                2124622.198, -2164534.614,   1377445.305, -2114478.485,
  //                -4704971.356, -7866057.432,   7002504.380, -2981734.692
  VLOAD_64(v2, 0x414b1e2b33d13be4, 0x414c00d8b8b34d48, 0x414d9c0bc4751d78,
           0x414a565bc4adf2d0, 0xc154c829dfc2d9f6, 0x411e71f0b7161c00,
           0x41622fe7619e55e2, 0x40fbcdcde34f1a00, 0x414035a7194d9794,
           0xc140839b4e886550, 0x413504a54df56888, 0xc14021d73e1606dc,
           0xc151f2b2d6cc57c8, 0xc15e01b25baceaba, 0x415ab6621850fa94,
           0xc146bfb358869da2);
  asm volatile("vfcvt.xu.f.v v3, v2");
  //                             3554390,                3670449, 3880984,
  //                             3452088,                      0, 498812,
  //                             9535291,                 113885, 2124622, 0,
  //                             1377445,                      0, 0, 0, 7002504,
  //                             0
  VCMP_U64(3, v3, 0x0000000000363c56, 0x00000000003801b1, 0x00000000003b3818,
           0x000000000034acb8, 0x0000000000000000, 0x0000000000079c7c,
           0x0000000000917f3b, 0x000000000001bcdd, 0x0000000000206b4e,
           0x0000000000000000, 0x00000000001504a5, 0x0000000000000000,
           0x0000000000000000, 0x0000000000000000, 0x00000000006ad988,
           0x0000000000000000);
};

// Simple random test with similar values (masked)
// The numbers are the same of TEST_CASE1
void TEST_CASE2(void) {
  VSET(16, e16, m1);
  //              -2372.000,   2978.000, -5132.000, -3426.000, -3878.000,
  //              9680.000,   76.000, -8128.000, -2314.000, -4660.000, 8672.000,
  //              8824.000, -5732.000, -1557.000, -2302.000, -407.250
  VLOAD_16(v2, 0xe8a2, 0x69d1, 0xed03, 0xeab1, 0xeb93, 0x70ba, 0x54c0, 0xeff0,
           0xe885, 0xec8d, 0x703c, 0x704f, 0xed99, 0xe615, 0xe87f, 0xde5d);
  VLOAD_8(v0, 0xAA, 0xAA);
  VCLEAR(v3);
  asm volatile("vfcvt.xu.f.v v3, v2, v0.t");
  //                       0,       2978,          0,          0,          0,
  //                       9680,          0,          0,          0,          0,
  //                       0,       8824,          0,          0,          0, 0
  VCMP_U16(4, v3, 0x0000, 0x0ba2, 0x0000, 0x0000, 0x0000, 0x25d0, 0x0000,
           0x0000, 0x0000, 0x0000, 0x0000, 0x2278, 0x0000, 0x0000, 0x0000,
           0x0000);

  VSET(16, e32, m1);
  //              -82436.352, -5427.481, -30119.082,   53784.066,   76500.719,
  //              65152.020, -94151.375,   71894.320, -20547.545,   95485.906,
  //              92834.711, -28081.711, -9716.506,   62508.508,   90410.883,
  //              42708.285
  VLOAD_32(v2, 0xc7a1022d, 0xc5a99bd9, 0xc6eb4e2a, 0x47521811, 0x47956a5c,
           0x477e8005, 0xc7b7e3b0, 0x478c6b29, 0xc6a08717, 0x47ba7ef4,
           0x47b5515b, 0xc6db636c, 0xc617d206, 0x47742c82, 0x47b09571,
           0x4726d449);
  VLOAD_8(v0, 0xAA, 0xAA);
  VCLEAR(v3);
  asm volatile("vfcvt.xu.f.v v3, v2, v0.t");
  //                           0,              0,              0, 53784, 0,
  //                           65152,              0,          71894, 0, 95486,
  //                           0,              0,              0, 62509, 0,
  //                           42708
  VCMP_U32(5, v3, 0x00000000, 0x00000000, 0x00000000, 0x0000d218, 0x00000000,
           0x0000fe80, 0x00000000, 0x000118d6, 0x00000000, 0x000174fe,
           0x00000000, 0x00000000, 0x00000000, 0x0000f42d, 0x00000000,
           0x0000a6d4);

  VSET(16, e64, m1);
  //                3554390.405,   3670449.443,   3880983.535,   3452087.537,
  //                -5447847.496,   498812.179,   9535291.051,   113884.868,
  //                2124622.198, -2164534.614,   1377445.305, -2114478.485,
  //                -4704971.356, -7866057.432,   7002504.380, -2981734.692
  VLOAD_64(v2, 0x414b1e2b33d13be4, 0x414c00d8b8b34d48, 0x414d9c0bc4751d78,
           0x414a565bc4adf2d0, 0xc154c829dfc2d9f6, 0x411e71f0b7161c00,
           0x41622fe7619e55e2, 0x40fbcdcde34f1a00, 0x414035a7194d9794,
           0xc140839b4e886550, 0x413504a54df56888, 0xc14021d73e1606dc,
           0xc151f2b2d6cc57c8, 0xc15e01b25baceaba, 0x415ab6621850fa94,
           0xc146bfb358869da2);
  VLOAD_8(v0, 0xAA, 0xAA);
  VCLEAR(v3);
  asm volatile("vfcvt.xu.f.v v3, v2, v0.t");
  //                                   0,                3670449, 0, 3452088, 0,
  //                                   498812,                      0, 113885,
  //                                   0,                      0, 0, 0, 0, 0, 0,
  //                                   0
  VCMP_U64(6, v3, 0x0000000000000000, 0x00000000003801b1, 0x0000000000000000,
           0x000000000034acb8, 0x0000000000000000, 0x0000000000079c7c,
           0x0000000000000000, 0x000000000001bcdd, 0x0000000000000000,
           0x0000000000000000, 0x0000000000000000, 0x0000000000000000,
           0x0000000000000000, 0x0000000000000000, 0x0000000000000000,
           0x0000000000000000);
};

///////////////
// vfcvt.x.f //
///////////////

// Unmasked vfcvt.x.f.c
void TEST_CASE3(void) {
  VSET(16, e16, m1);
  //                4144.000, -861.500, -8680.000,   3792.000,   8800.000,
  //                -2330.000, -3066.000, -6148.000,   4776.000,   7360.000,
  //                -7880.000, -1843.000, -7896.000, -6520.000, -7092.000,
  //                -8344.000
  VLOAD_16(v2, 0x6c0c, 0xe2bb, 0xf03d, 0x6b68, 0x704c, 0xe88d, 0xe9fd, 0xee01,
           0x6caa, 0x6f30, 0xefb2, 0xe733, 0xefb6, 0xee5e, 0xeeed, 0xf013);
  asm volatile("vfcvt.x.f.v v3, v2");
  //                    4144,       -862,      -8680,       3792,       8800,
  //                    -2330,      -3066,      -6148,       4776,       7360,
  //                    -7880,      -1843,      -7896,      -6520,      -7092,
  //                    -8344
  VCMP_U16(7, v3, 0x1030, 0xfca2, 0xde18, 0x0ed0, 0x2260, 0xf6e6, 0xf406,
           0xe7fc, 0x12a8, 0x1cc0, 0xe138, 0xf8cd, 0xe128, 0xe688, 0xe44c,
           0xdf68);

  VSET(16, e32, m1);
  //              -28075.818, -5455.616,   6106.086, -11952.592, -50887.914,
  //              -23028.832, -9221.246, -71657.047, -6655.005, -21208.561,
  //              -30018.096, -19766.838,   48541.953, -62313.625,   13515.192,
  //              -83224.820
  VLOAD_32(v2, 0xc6db57a3, 0xc5aa7ced, 0x45bed0b1, 0xc63ac25e, 0xc746c7ea,
           0xc6b3e9aa, 0xc61014fc, 0xc78bf486, 0xc5cff80a, 0xc6a5b11f,
           0xc6ea8431, 0xc69a6dad, 0x473d9df4, 0xc77369a0, 0x46532cc5,
           0xc7a28c69);
  asm volatile("vfcvt.x.f.v v3, v2");
  //                      -28076,          -5456,           6106, -11953,
  //                      -50888,         -23029,          -9221, -71657, -6655,
  //                      -21209,         -30018,         -19767, 48542, -62314,
  //                      13515,         -83225
  VCMP_U32(8, v3, 0xffff9254, 0xffffeab0, 0x000017da, 0xffffd14f, 0xffff3938,
           0xffffa60b, 0xffffdbfb, 0xfffee817, 0xffffe601, 0xffffad27,
           0xffff8abe, 0xffffb2c9, 0x0000bd9e, 0xffff0c96, 0x000034cb,
           0xfffebae7);

  VSET(16, e64, m1);
  //                         3087905.033,           -2534011.630, 7824302.813,
  //                         -9294206.521,   6436555.847,   6645117.193,
  //                         1358075.867,   5694551.012, -9840938.636,
  //                         4621816.383,   2584370.751,   5569558.860,
  //                         495487.041,   4759865.418, -6831172.669,
  //                         8371055.296
  VLOAD_64(v2, 0x41478f10842c8b9c, 0xc143553dd0971c82, 0x415dd8ebb40e1fe0,
           0xc161ba2fd0a8a593, 0x41588db2f632700c, 0x4159595f4c588b60,
           0x4134b8fbde131210, 0x4155b915c0cb4294, 0xc162c52554566300,
           0x4151a17e187d1aa8, 0x4143b7996029dc68, 0x41553f05b70b6824,
           0x411e3dfc2a598ba0, 0x4152284e5ac4da5a, 0xc15a0f112acbf258,
           0x415feedbd2ed6038);
  asm volatile("vfcvt.x.f.v v3, v2");
  //                             3087905,               -2534012, 7824303,
  //                             -9294207,                6436556, 6645117,
  //                             1358076,                5694551, -9840939,
  //                             4621816,                2584371, 5569559,
  //                             495487,                4759865, -6831173,
  //                             8371055
  VCMP_U64(9, v3, 0x00000000002f1e21, 0xffffffffffd95584, 0x00000000007763af,
           0xffffffffff722e81, 0x00000000006236cc, 0x000000000065657d,
           0x000000000014b8fc, 0x000000000056e457, 0xffffffffff69d6d5,
           0x00000000004685f8, 0x0000000000276f33, 0x000000000054fc17,
           0x0000000000078f7f, 0x000000000048a139, 0xffffffffff97c3bb,
           0x00000000007fbb6f);
};

// Masked vfcvt.x.f.c
void TEST_CASE4(void) {
  VSET(16, e16, m1);
  //                4144.000, -861.500, -8680.000,   3792.000,   8800.000,
  //                -2330.000, -3066.000, -6148.000,   4776.000,   7360.000,
  //                -7880.000, -1843.000, -7896.000, -6520.000, -7092.000,
  //                -8344.000
  VLOAD_16(v2, 0x6c0c, 0xe2bb, 0xf03d, 0x6b68, 0x704c, 0xe88d, 0xe9fd, 0xee01,
           0x6caa, 0x6f30, 0xefb2, 0xe733, 0xefb6, 0xee5e, 0xeeed, 0xf013);
  VLOAD_8(v0, 0xAA, 0xAA);
  VCLEAR(v3);
  asm volatile("vfcvt.x.f.v v3, v2, v0.t");
  //                       0,       -862,          0,       3792,          0,
  //                       -2330,          0,      -6148,          0, 7360, 0,
  //                       -1843,          0,      -6520,          0,      -8344
  VCMP_U16(10, v3, 0x0000, 0xfca2, 0x0000, 0x0ed0, 0x0000, 0xf6e6, 0x0000,
           0xe7fc, 0x0000, 0x1cc0, 0x0000, 0xf8cd, 0x0000, 0xe688, 0x0000,
           0xdf68);

  VSET(16, e32, m1);
  //                  -28075.818,      -5455.616,       6106.086, -11952.592,
  //                  -50887.914,     -23028.832,      -9221.246, -71657.047,
  //                  -6655.005, -21208.561, -30018.096, -19766.838, 48541.953,
  //                  -62313.625,   13515.192, -83224.820
  VLOAD_32(v2, 0xc6db57a3, 0xc5aa7ced, 0x45bed0b1, 0xc63ac25e, 0xc746c7ea,
           0xc6b3e9aa, 0xc61014fc, 0xc78bf486, 0xc5cff80a, 0xc6a5b11f,
           0xc6ea8431, 0xc69a6dad, 0x473d9df4, 0xc77369a0, 0x46532cc5,
           0xc7a28c69);
  VLOAD_8(v0, 0xAA, 0xAA);
  VCLEAR(v3);
  asm volatile("vfcvt.x.f.v v3, v2, v0.t");
  //                           0,          -5456,              0, -11953, 0,
  //                           -23029,              0,         -71657, 0,
  //                           -21209,              0,         -19767, 0,
  //                           -62314,              0,         -83225
  VCMP_U32(11, v3, 0x00000000, 0xffffeab0, 0x00000000, 0xffffd14f, 0x00000000,
           0xffffa60b, 0x00000000, 0xfffee817, 0x00000000, 0xffffad27,
           0x00000000, 0xffffb2c9, 0x00000000, 0xffff0c96, 0x00000000,
           0xfffebae7);

  VSET(16, e64, m1);
  //                3087905.033, -2534011.630,   7824302.813, -9294206.521,
  //                6436555.847,   6645117.193,   1358075.867,   5694551.012,
  //                -9840938.636,   4621816.383,   2584370.751,   5569558.860,
  //                495487.041,   4759865.418, -6831172.669,   8371055.296
  VLOAD_64(v2, 0x41478f10842c8b9c, 0xc143553dd0971c82, 0x415dd8ebb40e1fe0,
           0xc161ba2fd0a8a593, 0x41588db2f632700c, 0x4159595f4c588b60,
           0x4134b8fbde131210, 0x4155b915c0cb4294, 0xc162c52554566300,
           0x4151a17e187d1aa8, 0x4143b7996029dc68, 0x41553f05b70b6824,
           0x411e3dfc2a598ba0, 0x4152284e5ac4da5a, 0xc15a0f112acbf258,
           0x415feedbd2ed6038);
  VLOAD_8(v0, 0xAA, 0xAA);
  VCLEAR(v3);
  asm volatile("vfcvt.x.f.v v3, v2, v0.t");
  //                                   0,               -2534012, 0, -9294207,
  //                                   0,                6645117, 0, 5694551, 0,
  //                                   4621816,                      0, 5569559,
  //                                   0,                4759865, 0, 8371055
  VCMP_U64(12, v3, 0x0000000000000000, 0xffffffffffd95584, 0x0000000000000000,
           0xffffffffff722e81, 0x0000000000000000, 0x000000000065657d,
           0x0000000000000000, 0x000000000056e457, 0x0000000000000000,
           0x00000000004685f8, 0x0000000000000000, 0x000000000054fc17,
           0x0000000000000000, 0x000000000048a139, 0x0000000000000000,
           0x00000000007fbb6f);
};

////////////////////
// vfcvt.rtz.xu.f //
////////////////////

// Simple random test with similar values
void TEST_CASE5(void) {
  VSET(16, e16, m1);
  //                6996.000, -7512.000, -4792.000,   7240.000,   8336.000,
  //                6332.000, -277.750, -4074.000,   9352.000,   8832.000,
  //                -65.000,   5860.000,   6892.000,   2944.000,   9608.000,
  //                4608.000
  VLOAD_16(v2, 0x6ed5, 0xef56, 0xecae, 0x6f12, 0x7012, 0x6e2f, 0xdc57, 0xebf5,
           0x7091, 0x7050, 0xd410, 0x6db9, 0x6ebb, 0x69c0, 0x70b1, 0x6c80);
  asm volatile("vfcvt.rtz.xu.f.v v3, v2");
  //                    6996,          0,          0,       7240,       8336,
  //                    6332,          0,          0,       9352,       8832, 0,
  //                    5860,       6892,       2944,       9608,       4608
  VCMP_U16(13, v3, 0x1b54, 0x0000, 0x0000, 0x1c48, 0x2090, 0x18bc, 0x0000,
           0x0000, 0x2488, 0x2280, 0x0000, 0x16e4, 0x1aec, 0x0b80, 0x2588,
           0x1200);

  VSET(16, e32, m1);
  //                85074.883, -2035.769,   67397.633, -57745.480,   82113.172,
  //                18415.770,   57859.465,   83291.773, -83693.375, 43321.199,
  //                94626.156, -53520.090,   9604.658, -5764.834,   94299.633,
  //                57572.980
  VLOAD_32(v2, 0x47a62971, 0xc4fe789f, 0x4783a2d1, 0xc761917b, 0x47a06096,
           0x468fdf8a, 0x47620377, 0x47a2ade3, 0xc7a376b0, 0x47293933,
           0x47b8d114, 0xc7511017, 0x461612a2, 0xc5b426ac, 0x47b82dd1,
           0x4760e4fb);
  asm volatile("vfcvt.rtz.xu.f.v v3, v2");
  //                       85074,              0,          67397, 0, 82113,
  //                       18415,          57859,          83291, 0, 43321,
  //                       94626,              0,           9604, 0, 94299,
  //                       57572
  VCMP_U32(14, v3, 0x00014c52, 0x00000000, 0x00010745, 0x00000000, 0x000140c1,
           0x000047ef, 0x0000e203, 0x0001455b, 0x00000000, 0x0000a939,
           0x000171a2, 0x00000000, 0x00002584, 0x00000000, 0x0001705b,
           0x0000e0e4);

  VSET(16, e64, m1);
  //              -5386285.220, -9081004.335, -9603879.062, -4621060.923,
  //              2017661.058,   1106405.978, -2095853.299,   1911589.313,
  //              4833261.528,   1291127.404, -9941577.120,   9259799.184,
  //              -8569693.727,   4926687.920, -7537625.130, -6328586.289
  VLOAD_64(v2, 0xc1548c0b4e12be63, 0xc16152158ab92a41, 0xc1625164e1fd6af4,
           0xc151a0c13b0c041c, 0x413ec97d0edd7a68, 0x4130e1e5fa5c8120,
           0xc13ffaed4c78fc7c, 0x413d2b2550357b50, 0x41526ffb61d23f42,
           0x4133b377675b6328, 0xc162f64923d5cce3, 0x4161a962e5e3a1e8,
           0xc160586bb74734b0, 0x4152cb37fae70f80, 0xc15cc0f6484f174c,
           0xc1582442928257b8);
  asm volatile("vfcvt.rtz.xu.f.v v3, v2");
  //                                   0,                      0, 0, 0, 2017661,
  //                                   1106405,                      0, 1911589,
  //                                   4833261,                1291127, 0,
  //                                   9259799,                      0, 4926687,
  //                                   0,                      0
  VCMP_U64(15, v3, 0x0000000000000000, 0x0000000000000000, 0x0000000000000000,
           0x0000000000000000, 0x00000000001ec97d, 0x000000000010e1e5,
           0x0000000000000000, 0x00000000001d2b25, 0x000000000049bfed,
           0x000000000013b377, 0x0000000000000000, 0x00000000008d4b17,
           0x0000000000000000, 0x00000000004b2cdf, 0x0000000000000000,
           0x0000000000000000);
};

// Simple random test with similar values (masked)
// The numbers are the same of TEST_CASE1
void TEST_CASE6(void) {
  VSET(16, e16, m1);
  //                6996.000, -7512.000, -4792.000,   7240.000,   8336.000,
  //                6332.000, -277.750, -4074.000,   9352.000,   8832.000,
  //                -65.000,   5860.000,   6892.000,   2944.000,   9608.000,
  //                4608.000
  VLOAD_16(v2, 0x6ed5, 0xef56, 0xecae, 0x6f12, 0x7012, 0x6e2f, 0xdc57, 0xebf5,
           0x7091, 0x7050, 0xd410, 0x6db9, 0x6ebb, 0x69c0, 0x70b1, 0x6c80);
  VLOAD_8(v0, 0xAA, 0xAA);
  VCLEAR(v3);
  asm volatile("vfcvt.rtz.xu.f.v v3, v2, v0.t");
  //                       0,          0,          0,       7240,          0,
  //                       6332,          0,          0,          0,       8832,
  //                       0,       5860,          0,       2944,          0,
  //                       4608
  VCMP_U16(16, v3, 0x0000, 0x0000, 0x0000, 0x1c48, 0x0000, 0x18bc, 0x0000,
           0x0000, 0x0000, 0x2280, 0x0000, 0x16e4, 0x0000, 0x0b80, 0x0000,
           0x1200);

  VSET(16, e32, m1);
  //                85074.883, -2035.769,   67397.633, -57745.480,   82113.172,
  //                18415.770,   57859.465,   83291.773, -83693.375, 43321.199,
  //                94626.156, -53520.090,   9604.658, -5764.834,   94299.633,
  //                57572.980
  VLOAD_32(v2, 0x47a62971, 0xc4fe789f, 0x4783a2d1, 0xc761917b, 0x47a06096,
           0x468fdf8a, 0x47620377, 0x47a2ade3, 0xc7a376b0, 0x47293933,
           0x47b8d114, 0xc7511017, 0x461612a2, 0xc5b426ac, 0x47b82dd1,
           0x4760e4fb);
  VLOAD_8(v0, 0xAA, 0xAA);
  VCLEAR(v3);
  asm volatile("vfcvt.rtz.xu.f.v v3, v2, v0.t");
  //                           0,              0,              0, 0, 0, 18415,
  //                           0,          83291,              0, 43321, 0, 0,
  //                           0,              0,              0,          57572
  VCMP_U32(17, v3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
           0x000047ef, 0x00000000, 0x0001455b, 0x00000000, 0x0000a939,
           0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
           0x0000e0e4);

  VSET(16, e64, m1);
  //              -5386285.220, -9081004.335, -9603879.062, -4621060.923,
  //              2017661.058,   1106405.978, -2095853.299,   1911589.313,
  //              4833261.528,   1291127.404, -9941577.120,   9259799.184,
  //              -8569693.727,   4926687.920, -7537625.130, -6328586.289
  VLOAD_64(v2, 0xc1548c0b4e12be63, 0xc16152158ab92a41, 0xc1625164e1fd6af4,
           0xc151a0c13b0c041c, 0x413ec97d0edd7a68, 0x4130e1e5fa5c8120,
           0xc13ffaed4c78fc7c, 0x413d2b2550357b50, 0x41526ffb61d23f42,
           0x4133b377675b6328, 0xc162f64923d5cce3, 0x4161a962e5e3a1e8,
           0xc160586bb74734b0, 0x4152cb37fae70f80, 0xc15cc0f6484f174c,
           0xc1582442928257b8);
  VLOAD_8(v0, 0xAA, 0xAA);
  VCLEAR(v3);
  asm volatile("vfcvt.rtz.xu.f.v v3, v2, v0.t");
  //                                   0,                      0, 0, 0, 0,
  //                                   1106405,                      0, 1911589,
  //                                   0,                1291127, 0, 9259799, 0,
  //                                   4926687,                      0, 0
  VCMP_U64(18, v3, 0x0000000000000000, 0x0000000000000000, 0x0000000000000000,
           0x0000000000000000, 0x0000000000000000, 0x000000000010e1e5,
           0x0000000000000000, 0x00000000001d2b25, 0x0000000000000000,
           0x000000000013b377, 0x0000000000000000, 0x00000000008d4b17,
           0x0000000000000000, 0x00000000004b2cdf, 0x0000000000000000,
           0x0000000000000000);
};

///////////////////
// vfcvt.rtz.x.f //
///////////////////

// Simple random test with similar values
void TEST_CASE7(void) {
  VSET(16, e16, m1);
  //                5116.000,   4640.000,   5720.000,   1316.000,   8104.000,
  //                9952.000,   9400.000, -4120.000, -9368.000,   6076.000,
  //                1782.000, -5332.000, -4284.000, -2878.000, -2752.000,
  //                3714.000
  VLOAD_16(v2, 0x6cff, 0x6c88, 0x6d96, 0x6524, 0x6fea, 0x70dc, 0x7097, 0xec06,
           0xf093, 0x6def, 0x66f6, 0xed35, 0xec2f, 0xe99f, 0xe960, 0x6b41);
  asm volatile("vfcvt.rtz.x.f.v v3, v2");
  //                    5116,       4640,       5720,       1316,       8104,
  //                    9952,       9400,      -4120,      -9368,       6076,
  //                    1782,      -5332,      -4284,      -2878,      -2752,
  //                    3714
  VCMP_U16(19, v3, 0x13fc, 0x1220, 0x1658, 0x0524, 0x1fa8, 0x26e0, 0x24b8,
           0xefe8, 0xdb68, 0x17bc, 0x06f6, 0xeb2c, 0xef44, 0xf4c2, 0xf540,
           0x0e82);

  VSET(16, e32, m1);
  //              -31395.312,   38407.539,   39625.664, -19419.770, -77414.898,
  //              -96104.727, -8227.330, -45789.250, -74805.781,   78266.945,
  //              1635.832, -33150.762,   17428.920, -93694.898,   93592.562,
  //              -83328.680
  VLOAD_32(v2, 0xc6f546a0, 0x4716078a, 0x471ac9aa, 0xc697b78a, 0xc7973373,
           0xc7bbb45d, 0xc6008d52, 0xc732dd40, 0xc7921ae4, 0x4798dd79,
           0x44cc7aa0, 0xc7017ec3, 0x468829d7, 0xc7b6ff73, 0x47b6cc48,
           0xc7a2c057);
  asm volatile("vfcvt.rtz.x.f.v v3, v2");
  //                      -31395,          38407,          39625, -19419,
  //                      -77414,         -96104,          -8227, -45789,
  //                      -74805,          78266,           1635, -33150, 17428,
  //                      -93694,          93592,         -83328
  VCMP_U32(20, v3, 0xffff855d, 0x00009607, 0x00009ac9, 0xffffb425, 0xfffed19a,
           0xfffe8898, 0xffffdfdd, 0xffff4d23, 0xfffedbcb, 0x000131ba,
           0x00000663, 0xffff7e82, 0x00004414, 0xfffe9202, 0x00016d98,
           0xfffeba80);

  VSET(16, e64, m1);
  //                1347922.217,   7326256.926,   2532328.150, -4365139.352,
  //                -3892733.643, -3401324.772, -2109243.969,   61221.157,
  //                -307581.498, -6001564.901, -1299579.664, -2048360.900,
  //                3486773.936, -5491246.977, -2222467.648,   1432204.815
  VLOAD_64(v2, 0x413491523797bd28, 0x415bf28c3b410560, 0x414351f41339c8f8,
           0xc150a6d4d6864763, 0xc14db2fed245a01c, 0xc149f33662d1f60e,
           0xc140179dfc15a4ac, 0x40ede4a503831a00, 0xc112c5f5fdac3c80,
           0xc156e4e739a40168, 0xc133d47ba9e7da00, 0xc13f4168e650cc0c,
           0x414a9a1af7c5dda0, 0xc154f28bbe844db6, 0xc140f4c1d2e7a21a,
           0x4135da8cd09570f8);
  asm volatile("vfcvt.rtz.x.f.v v3, v2");
  //                             1347922,                7326256, 2532328,
  //                             -4365139,               -3892733, -3401324,
  //                             -2109243,                  61221, -307581,
  //                             -6001564,               -1299579, -2048360,
  //                             3486773,               -5491246, -2222467,
  //                             1432204
  VCMP_U64(21, v3, 0x0000000000149152, 0x00000000006fca30, 0x000000000026a3e8,
           0xffffffffffbd64ad, 0xffffffffffc49a03, 0xffffffffffcc1994,
           0xffffffffffdfd0c5, 0x000000000000ef25, 0xfffffffffffb4e83,
           0xffffffffffa46c64, 0xffffffffffec2b85, 0xffffffffffe0be98,
           0x0000000000353435, 0xffffffffffac35d2, 0xffffffffffde167d,
           0x000000000015da8c);
};

// Simple random test with similar values (masked)
// The numbers are the same of TEST_CASE1
void TEST_CASE8(void) {
  VSET(16, e16, m1);
  //                5116.000,   4640.000,   5720.000,   1316.000,   8104.000,
  //                9952.000,   9400.000, -4120.000, -9368.000,   6076.000,
  //                1782.000, -5332.000, -4284.000, -2878.000, -2752.000,
  //                3714.000
  VLOAD_16(v2, 0x6cff, 0x6c88, 0x6d96, 0x6524, 0x6fea, 0x70dc, 0x7097, 0xec06,
           0xf093, 0x6def, 0x66f6, 0xed35, 0xec2f, 0xe99f, 0xe960, 0x6b41);
  VLOAD_8(v0, 0xAA, 0xAA);
  VCLEAR(v3);
  asm volatile("vfcvt.rtz.x.f.v v3, v2, v0.t");
  //                       0,       4640,          0,       1316,          0,
  //                       9952,          0,      -4120,          0,       6076,
  //                       0,      -5332,          0,      -2878,          0,
  //                       3714
  VCMP_U16(22, v3, 0x0000, 0x1220, 0x0000, 0x0524, 0x0000, 0x26e0, 0x0000,
           0xefe8, 0x0000, 0x17bc, 0x0000, 0xeb2c, 0x0000, 0xf4c2, 0x0000,
           0x0e82);

  VSET(16, e32, m1);
  //              -31395.312,   38407.539,   39625.664, -19419.770, -77414.898,
  //              -96104.727, -8227.330, -45789.250, -74805.781,   78266.945,
  //              1635.832, -33150.762,   17428.920, -93694.898,   93592.562,
  //              -83328.680
  VLOAD_32(v2, 0xc6f546a0, 0x4716078a, 0x471ac9aa, 0xc697b78a, 0xc7973373,
           0xc7bbb45d, 0xc6008d52, 0xc732dd40, 0xc7921ae4, 0x4798dd79,
           0x44cc7aa0, 0xc7017ec3, 0x468829d7, 0xc7b6ff73, 0x47b6cc48,
           0xc7a2c057);
  VLOAD_8(v0, 0xAA, 0xAA);
  VCLEAR(v3);
  asm volatile("vfcvt.rtz.x.f.v v3, v2, v0.t");
  //                           0,          38407,              0, -19419, 0,
  //                           -96104,              0,         -45789, 0, 78266,
  //                           0,         -33150,              0, -93694, 0,
  //                           -83328
  VCMP_U32(23, v3, 0x00000000, 0x00009607, 0x00000000, 0xffffb425, 0x00000000,
           0xfffe8898, 0x00000000, 0xffff4d23, 0x00000000, 0x000131ba,
           0x00000000, 0xffff7e82, 0x00000000, 0xfffe9202, 0x00000000,
           0xfffeba80);

  VSET(16, e64, m1);
  //                1347922.217,   7326256.926,   2532328.150, -4365139.352,
  //                -3892733.643, -3401324.772, -2109243.969,   61221.157,
  //                -307581.498, -6001564.901, -1299579.664, -2048360.900,
  //                3486773.936, -5491246.977, -2222467.648,   1432204.815
  VLOAD_64(v2, 0x413491523797bd28, 0x415bf28c3b410560, 0x414351f41339c8f8,
           0xc150a6d4d6864763, 0xc14db2fed245a01c, 0xc149f33662d1f60e,
           0xc140179dfc15a4ac, 0x40ede4a503831a00, 0xc112c5f5fdac3c80,
           0xc156e4e739a40168, 0xc133d47ba9e7da00, 0xc13f4168e650cc0c,
           0x414a9a1af7c5dda0, 0xc154f28bbe844db6, 0xc140f4c1d2e7a21a,
           0x4135da8cd09570f8);
  VLOAD_8(v0, 0xAA, 0xAA);
  VCLEAR(v3);
  asm volatile("vfcvt.rtz.x.f.v v3, v2, v0.t");
  //                                   0,                7326256, 0, -4365139,
  //                                   0,               -3401324, 0, 61221, 0,
  //                                   -6001564,                      0,
  //                                   -2048360,                      0,
  //                                   -5491246,                      0, 1432204
  VCMP_U64(24, v3, 0x0000000000000000, 0x00000000006fca30, 0x0000000000000000,
           0xffffffffffbd64ad, 0x0000000000000000, 0xffffffffffcc1994,
           0x0000000000000000, 0x000000000000ef25, 0x0000000000000000,
           0xffffffffffa46c64, 0x0000000000000000, 0xffffffffffe0be98,
           0x0000000000000000, 0xffffffffffac35d2, 0x0000000000000000,
           0x000000000015da8c);
};

////////////////
// vfcvt.f.xu //
////////////////

void TEST_CASE9(void) {
  VSET(16, e16, m1);
  //                   55973,      61786,      64322,      55940,      55857,
  //                   3425,       1068,       4246,      57901,       7342,
  //                   8693,      60988,       9047,      63358,      58389,
  //                   8076
  VLOAD_16(v2, 0xdaa5, 0xf15a, 0xfb42, 0xda84, 0xda31, 0x0d61, 0x042c, 0x1096,
           0xe22d, 0x1cae, 0x21f5, 0xee3c, 0x2357, 0xf77e, 0xe415, 0x1f8c);
  asm volatile("vfcvt.f.xu.v v3, v2");
  //                55968.000,   61792.000,   64320.000,   55936.000, 55872.000,
  //                3424.000,   1068.000,   4248.000,   57888.000,   7344.000,
  //                8696.000,   60992.000,   9048.000,   63360.000,   58400.000,
  //                8076.000
  VCMP_U16(25, v3, 0x7ad5, 0x7b8b, 0x7bda, 0x7ad4, 0x7ad2, 0x6ab0, 0x642c,
           0x6c26, 0x7b11, 0x6f2c, 0x703f, 0x7b72, 0x706b, 0x7bbc, 0x7b21,
           0x6fe3);

  VSET(16, e32, m1);
  //                       72473,     4294949057,          50975, 4294915723,
  //                       4294876584,     4294895088,          24967, 34761,
  //                       83805,          68361,          49397, 51562, 24877,
  //                       4294942241,     4294909502,          42562
  VLOAD_32(v2, 0x00011b19, 0xffffb8c1, 0x0000c71f, 0xffff368b, 0xfffe9da8,
           0xfffee5f0, 0x00006187, 0x000087c9, 0x0001475d, 0x00010b09,
           0x0000c0f5, 0x0000c96a, 0x0000612d, 0xffff9e21, 0xffff1e3e,
           0x0000a642);
  asm volatile("vfcvt.f.xu.v v3, v2");
  //                72473.000,   4294949120.000,   50975.000,   4294915840.000,
  //                4294876672.000,   4294895104.000,   24967.000,   34761.000,
  //                83805.000,   68361.000,   49397.000,   51562.000, 24877.000,
  //                4294942208.000,   4294909440.000,   42562.000
  VCMP_U32(26, v3, 0x478d8c80, 0x4f7fffb9, 0x47471f00, 0x4f7fff37, 0x4f7ffe9e,
           0x4f7ffee6, 0x46c30e00, 0x4707c900, 0x47a3ae80, 0x47858480,
           0x4740f500, 0x47496a00, 0x46c25a00, 0x4f7fff9e, 0x4f7fff1e,
           0x47264200);

  VSET(16, e64, m1);
  //                 18446744073707704187,    18446744073702261660, 4325496,
  //                 3834488,    18446744073707063867,    18446744073706356425,
  //                 5215660,    18446744073707545423,                  69532,
  //                 18446744073707444829,                4236283, 3402850,
  //                 18446744073708706866,                 275183, 4230347,
  //                 18446744073704794800
  VLOAD_64(v2, 0xffffffffffe3cf7b, 0xffffffffff90c39c, 0x0000000000420078,
           0x00000000003a8278, 0xffffffffffda0a3b, 0xffffffffffcf3ec9,
           0x00000000004f95ac, 0xffffffffffe1634f, 0x0000000000010f9c,
           0xffffffffffdfda5d, 0x000000000040a3fb, 0x000000000033ec62,
           0xfffffffffff31c32, 0x00000000000432ef, 0x0000000000408ccb,
           0xffffffffffb76ab0);
  asm volatile("vfcvt.f.xu.v v3, v2");
  //                18446744073707704320.000,   18446744073702260736.000,
  //                4325496.000,   3834488.000,   18446744073707063296.000,
  //                18446744073706356736.000,   5215660.000,
  //                18446744073707544576.000,   69532.000,
  //                18446744073707444224.000,   4236283.000,   3402850.000,
  //                18446744073708707840.000,   275183.000,   4230347.000,
  //                18446744073704794112.000
  VCMP_U64(27, v3, 0x43effffffffffc7a, 0x43effffffffff218, 0x4150801e00000000,
           0x414d413c00000000, 0x43effffffffffb41, 0x43effffffffff9e8,
           0x4153e56b00000000, 0x43effffffffffc2c, 0x40f0f9c000000000,
           0x43effffffffffbfb, 0x415028fec0000000, 0x4149f63100000000,
           0x43effffffffffe64, 0x4110cbbc00000000, 0x41502332c0000000,
           0x43effffffffff6ed);
};

// Simple random test with similar values (masked)
// The numbers are the same of TEST_CASE1
void TEST_CASE10(void) {
  VSET(16, e16, m1);
  //                   55973,      61786,      64322,      55940,      55857,
  //                   3425,       1068,       4246,      57901,       7342,
  //                   8693,      60988,       9047,      63358,      58389,
  //                   8076
  VLOAD_16(v2, 0xdaa5, 0xf15a, 0xfb42, 0xda84, 0xda31, 0x0d61, 0x042c, 0x1096,
           0xe22d, 0x1cae, 0x21f5, 0xee3c, 0x2357, 0xf77e, 0xe415, 0x1f8c);
  VLOAD_8(v0, 0xAA, 0xAA);
  VCLEAR(v3);
  asm volatile("vfcvt.f.xu.v v3, v2, v0.t");
  //                0.000,   61792.000,   0.000,   55936.000,   0.000, 3424.000,
  //                0.000,   4248.000,   0.000,   7344.000,   0.000, 60992.000,
  //                0.000,   63360.000,   0.000,   8076.000
  VCMP_U16(28, v3, 0x0, 0x7b8b, 0x0, 0x7ad4, 0x0, 0x6ab0, 0x0, 0x6c26, 0x0,
           0x6f2c, 0x0, 0x7b72, 0x0, 0x7bbc, 0x0, 0x6fe3);

  VSET(16, e32, m1);
  //                       72473,     4294949057,          50975, 4294915723,
  //                       4294876584,     4294895088,          24967, 34761,
  //                       83805,          68361,          49397, 51562, 24877,
  //                       4294942241,     4294909502,          42562
  VLOAD_32(v2, 0x00011b19, 0xffffb8c1, 0x0000c71f, 0xffff368b, 0xfffe9da8,
           0xfffee5f0, 0x00006187, 0x000087c9, 0x0001475d, 0x00010b09,
           0x0000c0f5, 0x0000c96a, 0x0000612d, 0xffff9e21, 0xffff1e3e,
           0x0000a642);
  VLOAD_8(v0, 0xAA, 0xAA);
  VCLEAR(v3);
  asm volatile("vfcvt.f.xu.v v3, v2, v0.t");
  //                0.000,   4294949120.000,   0.000,   4294915840.000,   0.000,
  //                4294895104.000,   0.000,   34761.000,   0.000,   68361.000,
  //                0.000,   51562.000,   0.000,   4294942208.000,   0.000,
  //                42562.000
  VCMP_U32(29, v3, 0x0, 0x4f7fffb9, 0x0, 0x4f7fff37, 0x0, 0x4f7ffee6, 0x0,
           0x4707c900, 0x0, 0x47858480, 0x0, 0x47496a00, 0x0, 0x4f7fff9e, 0x0,
           0x47264200);

  VSET(16, e64, m1);
  //                 18446744073707704187,    18446744073702261660, 4325496,
  //                 3834488,    18446744073707063867,    18446744073706356425,
  //                 5215660,    18446744073707545423,                  69532,
  //                 18446744073707444829,                4236283, 3402850,
  //                 18446744073708706866,                 275183, 4230347,
  //                 18446744073704794800
  VLOAD_64(v2, 0xffffffffffe3cf7b, 0xffffffffff90c39c, 0x0000000000420078,
           0x00000000003a8278, 0xffffffffffda0a3b, 0xffffffffffcf3ec9,
           0x00000000004f95ac, 0xffffffffffe1634f, 0x0000000000010f9c,
           0xffffffffffdfda5d, 0x000000000040a3fb, 0x000000000033ec62,
           0xfffffffffff31c32, 0x00000000000432ef, 0x0000000000408ccb,
           0xffffffffffb76ab0);
  VLOAD_8(v0, 0xAA, 0xAA);
  VCLEAR(v3);
  asm volatile("vfcvt.f.xu.v v3, v2, v0.t");
  //                0.000,   18446744073702260736.000,   0.000,   3834488.000,
  //                0.000,   18446744073706356736.000,   0.000,
  //                18446744073707544576.000,   0.000, 18446744073707444224.000,
  //                0.000,   3402850.000,   0.000,   275183.000,   0.000,
  //                18446744073704794112.000
  VCMP_U64(30, v3, 0x0, 0x43effffffffff218, 0x0, 0x414d413c00000000, 0x0,
           0x43effffffffff9e8, 0x0, 0x43effffffffffc2c, 0x0, 0x43effffffffffbfb,
           0x0, 0x4149f63100000000, 0x0, 0x4110cbbc00000000, 0x0,
           0x43effffffffff6ed);
};

///////////////
// vfcvt.f.x //
///////////////

void TEST_CASE11(void) {
  VSET(16, e16, m1);
  //                   -4779,        465,       9893,      -6763,      -4072,
  //                   1612,      -9552,       2426,        325,       7561,
  //                   -8581,      -1741,      -8518,      -4699,       3653,
  //                   9937
  VLOAD_16(v2, 0xed55, 0x01d1, 0x26a5, 0xe595, 0xf018, 0x064c, 0xdab0, 0x097a,
           0x0145, 0x1d89, 0xde7b, 0xf933, 0xdeba, 0xeda5, 0x0e45, 0x26d1);
  asm volatile("vfcvt.f.x.v v3, v2");
  //              -4780.000,   465.000,   9896.000, -6764.000, -4072.000,
  //              1612.000, -9552.000,   2426.000,   325.000,   7560.000,
  //              -8584.000, -1741.000, -8520.000, -4700.000,   3652.000,
  //              9936.000
  VCMP_U16(31, v3, 0xecab, 0x5f44, 0x70d5, 0xee9b, 0xebf4, 0x664c, 0xf0aa,
           0x68bd, 0x5d14, 0x6f62, 0xf031, 0xe6cd, 0xf029, 0xec97, 0x6b22,
           0x70da);

  VSET(16, e32, m1);
  //                      -39422,          54262,          12833, -40266,
  //                      -64918,          28317,          89178, 54320, -99922,
  //                      -73005,          95070,         -24716, 60663, 59516,
  //                      14865,          26328
  VLOAD_32(v2, 0xffff6602, 0x0000d3f6, 0x00003221, 0xffff62b6, 0xffff026a,
           0x00006e9d, 0x00015c5a, 0x0000d430, 0xfffe79ae, 0xfffee2d3,
           0x0001735e, 0xffff9f74, 0x0000ecf7, 0x0000e87c, 0x00003a11,
           0x000066d8);
  asm volatile("vfcvt.f.x.v v3, v2");
  //              -39422.000,   54262.000,   12833.000, -40266.000, -64918.000,
  //              28317.000,   89178.000,   54320.000, -99922.000, -73005.000,
  //              95070.000, -24716.000,   60663.000,   59516.000,   14865.000,
  //              26328.000
  VCMP_U32(32, v3, 0xc719fe00, 0x4753f600, 0x46488400, 0xc71d4a00, 0xc77d9600,
           0x46dd3a00, 0x47ae2d00, 0x47543000, 0xc7c32900, 0xc78e9680,
           0x47b9af00, 0xc6c11800, 0x476cf700, 0x47687c00, 0x46684400,
           0x46cdb000);

  VSET(16, e64, m1);
  //                            -8860682,                8064547, -5636078,
  //                            -3712253,                8492493, 9839246,
  //                            -8271278,               -6234598, -4538479,
  //                            8807688,                5640899, 3839761,
  //                            -1394518,               -6118355, 1783927,
  //                            5819812
  VLOAD_64(v2, 0xffffffffff78cbf6, 0x00000000007b0e23, 0xffffffffffaa0012,
           0xffffffffffc75b03, 0x00000000008195cd, 0x000000000096228e,
           0xffffffffff81ca52, 0xffffffffffa0de1a, 0xffffffffffbabf91,
           0x0000000000866508, 0x00000000005612c3, 0x00000000003a9711,
           0xffffffffffeab8aa, 0xffffffffffa2a42d, 0x00000000001b3877,
           0x000000000058cda4);
  asm volatile("vfcvt.f.x.v v3, v2");
  //              -8860682.000,   8064547.000, -5636078.000, -3712253.000,
  //              8492493.000,   9839246.000, -8271278.000, -6234598.000,
  //              -4538479.000,   8807688.000,   5640899.000,   3839761.000,
  //              -1394518.000, -6118355.000,   1783927.000,   5819812.000
  VCMP_U64(33, v3, 0xc160e68140000000, 0x415ec388c0000000, 0xc1557ffb80000000,
           0xc14c527e80000000, 0x416032b9a0000000, 0x4162c451c0000000,
           0xc15f8d6b80000000, 0xc157c87980000000, 0xc151501bc0000000,
           0x4160cca100000000, 0x415584b0c0000000, 0x414d4b8880000000,
           0xc135475600000000, 0xc15756f4c0000000, 0x413b387700000000,
           0x4156336900000000);
};

// Simple random test with similar values (masked)
// The numbers are the same of TEST_CASE1
void TEST_CASE12(void) {
  VSET(16, e16, m1);
  //                   -4779,        465,       9893,      -6763,      -4072,
  //                   1612,      -9552,       2426,        325,       7561,
  //                   -8581,      -1741,      -8518,      -4699,       3653,
  //                   9937
  VLOAD_16(v2, 0xed55, 0x01d1, 0x26a5, 0xe595, 0xf018, 0x064c, 0xdab0, 0x097a,
           0x0145, 0x1d89, 0xde7b, 0xf933, 0xdeba, 0xeda5, 0x0e45, 0x26d1);
  VLOAD_8(v0, 0xAA, 0xAA);
  VCLEAR(v3);
  asm volatile("vfcvt.f.x.v v3, v2, v0.t");
  //                0.000,   465.000,   0.000, -6764.000,   0.000,   1612.000,
  //                0.000,   2426.000,   0.000,   7560.000,   0.000, -1741.000,
  //                0.000, -4700.000,   0.000,   9936.000
  VCMP_U16(34, v3, 0x0, 0x5f44, 0x0, 0xee9b, 0x0, 0x664c, 0x0, 0x68bd, 0x0,
           0x6f62, 0x0, 0xe6cd, 0x0, 0xec97, 0x0, 0x70da);

  VSET(16, e32, m1);
  //                      -39422,          54262,          12833, -40266,
  //                      -64918,          28317,          89178, 54320, -99922,
  //                      -73005,          95070,         -24716, 60663, 59516,
  //                      14865,          26328
  VLOAD_32(v2, 0xffff6602, 0x0000d3f6, 0x00003221, 0xffff62b6, 0xffff026a,
           0x00006e9d, 0x00015c5a, 0x0000d430, 0xfffe79ae, 0xfffee2d3,
           0x0001735e, 0xffff9f74, 0x0000ecf7, 0x0000e87c, 0x00003a11,
           0x000066d8);
  VLOAD_8(v0, 0xAA, 0xAA);
  VCLEAR(v3);
  asm volatile("vfcvt.f.x.v v3, v2, v0.t");
  //                0.000,   54262.000,   0.000, -40266.000,   0.000, 28317.000,
  //                0.000,   54320.000,   0.000, -73005.000,   0.000,
  //                -24716.000,   0.000,   59516.000,   0.000,   26328.000
  VCMP_U32(35, v3, 0x0, 0x4753f600, 0x0, 0xc71d4a00, 0x0, 0x46dd3a00, 0x0,
           0x47543000, 0x0, 0xc78e9680, 0x0, 0xc6c11800, 0x0, 0x47687c00, 0x0,
           0x46cdb000);

  VSET(16, e64, m1);
  //                            -8860682,                8064547, -5636078,
  //                            -3712253,                8492493, 9839246,
  //                            -8271278,               -6234598, -4538479,
  //                            8807688,                5640899, 3839761,
  //                            -1394518,               -6118355, 1783927,
  //                            5819812
  VLOAD_64(v2, 0xffffffffff78cbf6, 0x00000000007b0e23, 0xffffffffffaa0012,
           0xffffffffffc75b03, 0x00000000008195cd, 0x000000000096228e,
           0xffffffffff81ca52, 0xffffffffffa0de1a, 0xffffffffffbabf91,
           0x0000000000866508, 0x00000000005612c3, 0x00000000003a9711,
           0xffffffffffeab8aa, 0xffffffffffa2a42d, 0x00000000001b3877,
           0x000000000058cda4);
  VLOAD_8(v0, 0xAA, 0xAA);
  VCLEAR(v3);
  asm volatile("vfcvt.f.x.v v3, v2, v0.t");
  //                0.000,   8064547.000,   0.000, -3712253.000,   0.000,
  //                9839246.000,   0.000, -6234598.000,   0.000,   8807688.000,
  //                0.000,   3839761.000,   0.000, -6118355.000,   0.000,
  //                5819812.000
  VCMP_U64(36, v3, 0x0, 0x415ec388c0000000, 0x0, 0xc14c527e80000000, 0x0,
           0x4162c451c0000000, 0x0, 0xc157c87980000000, 0x0, 0x4160cca100000000,
           0x0, 0x414d4b8880000000, 0x0, 0xc15756f4c0000000, 0x0,
           0x4156336900000000);
};

int main(void) {
  enable_vec();
  enable_fp();

  TEST_CASE1();
  TEST_CASE2();

  TEST_CASE3();
  TEST_CASE4();

  TEST_CASE5();
  TEST_CASE6();

  TEST_CASE7();
  TEST_CASE8();

  TEST_CASE9();
  TEST_CASE10();

  TEST_CASE11();
  TEST_CASE12();

  EXIT_CHECK();
}
